# -*- coding: UTF-8 -*-
# @Time : 2021-01-26 22:34
# @File : Test_Appium.py
import time

import pytest
from config import Conf
from utils.LogUtil import my_log
from common.ExcelData import Data
from testcase.Appium.Appium import Appium
# 日志
log = my_log()
# 获取data数据文件路径
data = Data(Conf.get_data_file())
# 执行测试用例列表
run_list = data.run_list()


class Test_Appium:
    # def test_run(self, test):
    #     pass

    # def setup_class(self):
    #     self.driver = appium_desired_caps()

    # def setup(self):
    #     self.driver.launch_app()

    @pytest.mark.parametrize('run_case', run_list)
    def test_run(self, atart_appium_desired, run_case):  # atart_appium_desired, conftest
        self.driver = atart_appium_desired
        # self.driver.launch_app()
        log.info('执行用例内容：{}'.format(run_case))
        Appium(self.driver).test_step(data, run_case)

    # def teardown(self):
    #     self.driver.close_app()

    # def teardown_class(self):
    #     self.driver.quit()


